﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>plug.json插件配置</title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushJScript.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css"/>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>plug.json插件配置</h3>
    <p>
    1.plug.json文件，位于程序集生成目录中的Plugs目录下的插件目录中。<a href="4.插件目录结构.html">插件目录介绍</a>
    </p>
    <pre class="brush: javascript;">
    {
      //插件设置
      "plug":
        {
          //是否加载插件
          "enable": true,
          //插件名称
          "name": "NFinalCoreServerSample",
          //插件前缀
          "urlPrefix": null,
          //插件描述
          "description": "NFinalCore测试网站",
          //插件程序集所在路径
          "assemblyPath": "NFinalCoreServerSample.dll",
          //插件配置
          "configPath": "NFinalCoreServerSample.plug.json"
        },
      //用户自定义设置,与微软设置相同
      "appSettings": {
        "key": "value"
      },
      //连接字符串设置,与微软设置相同
      "connectionStrings": {
        "Common": {
          "connectionString": "Data Source=|ModuleDataDirectory|Common.db;Pooling=true;FailIfMissing=false",
          "providerName": "System.Data.SQLite"
        },
        "LeZhaiQuanStart": {
          "connectionString": "Server=192.168.1.1;Database=lzq;Uid=root;Pwd=root;",
          "providerName": "MySql.Data.MySqlClient"
        }
      },
      //该插件所能处理的请求方法
      "verbs": [ "GET", "POST", "HEAD", "DEBUG" ],
      //Session设置，与微软设置相同
      "sessionState": {
        "cookieName": "session_id",
        "mode": "Redis",
        "stateConnectionString": "localhost",
        "timeout": 20,
        "prefix": ""
      },
      //Url设置，用于处理控制器行为中的Url表达式。
      "url": {
        "prefix": "",
        "extension": ".html",
        "defaultDocument": "index.html"
      },
      //Cookie设置
      "cookie": {
        "prefix": ""
      },
      //默认皮肤
      "defaultSkin": null,
      //用户自定义错误，与微软设置相同
      "customErrors": {
        "defaultRedirect": "Err.htm",
        "mode": "Off",
        "errors": [
          {
            "statusCode": 403,
            "redirect": "NoAccess.htm"
          },
          {
            "statusCode": 404,
            "redirect": "FileNotFound.htm"
          }
        ]
      }
    }
    </pre>
</body>
</html>
